﻿using System;
using System.Windows.Forms;

namespace DPLAB.IPAMS.IPAMSGui.Form
{
    public partial class frmLoadExcelFile : frmBase
    {
        #region Private Member's

        #endregion

        #region Public Access 

        public String FileName { get; set; }

        #endregion

        #region Btn Event Code

        private void btnBrowes_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                txtFileName.Text = openFileDialog1.FileName;
                FileName = txtFileName.Text;
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (checkUserInput())
                Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            FileName = "";
            Close();
        }

        #endregion

        public frmLoadExcelFile()
        {
            InitializeComponent();
        }

        private bool checkUserInput()
        {
            if (FileName != "")
                return true;

            MessageBox.Show("You Musr choose source file.");
            return false;
        }
    }
}